In computer graphics, computer-aided geometric design and the like, an artist, draftsman or other user (generally referred to herein as an “operator”) attempts to generate a three-dimensional representation of objects in a scene, as maintained by a computer, and thereafter render respective two-dimensional images of the objects in the scene from one or more orientations. In the first, representation generation phase, conventionally, computer graphics systems generate a three-dimensional representation from, for example, various two-dimensional line drawings comprising contours and/or cross-sections of the objects in the scene and by applying a number of operations to such lines which will result in two-dimensional surfaces in three-dimensional space, and subsequent modification of parameters and control points of such surfaces to correct or otherwise modify the shape of the resulting representation of the object.
During this process, the operator also defines various properties of the surfaces of the objects, the structure and characteristics of light sources which illuminate the scene, and the structure and characteristics of one or more simulated cameras which generate the images. After the structure and characteristics of the scene, light source(s) and camera(s) have been defined, in the second phase, an operator enables the computer to render an image of the scene from a particular viewing direction.
The objects in the scene, light source(s) and camera(s) are defined, in the first, scene definition, phase, by respective multiple-dimensional mathematical representations, including at least the three spatial dimensions, and possibly one time dimension. The mathematical representations are typically stored in a tree-structured data structure. The properties of the surfaces of the objects, in turn, are defined by “shade trees,” each of which includes one or more shaders which, during the second, scene rendering, phase, enables the computer to render the respective surfaces, essentially providing color values representative of colors of the respective surfaces. The shaders of a shade tree are generated by an operator, or are provided a priori by a computer graphics system, in a high-level language such as C or C++, which together enable the computer to render an image of a respective surface in the second, scene rendering, phase.
A number of problems arise from the generation and use of shaders and shade trees as typically provided in computer graphics arrangements. First, shaders generally cannot cooperate with each other unless they are programmed to do so. Typically, input values provided to shaders are constant values, which limits the shaders' flexibility and ability to render features in an interesting and life-like manner. In addition, it is generally difficult to set up systems of cooperating shaders which can get their input values from a common source.
In order to provide solutions to such problems, the above cited U.S. Pat. No. 6,496,190 described a computer graphics system in which a new type of entity, referred to as a “phenomenon”, can be created, instantiated and used in rendering an image of a scene. A phenomenon is an encapsulated shader DAG (“directed acyclic graph”) comprising one or more nodes, each comprising a shader, or an encapsulated set of such DAGs which are interconnected so as to cooperate, which are instantiated and attached to entities in the scene which are created during the scene definition process to define diverse types of features of a scene, including color and textural features of surfaces of objects in the scene, characteristics of volumes and geometries in the scene, features of light sources illuminating the scene, features of simulated cameras which will be simulated during rendering, and numerous other features which are useful in rendering.
Phenomena selected for use by an operator in connection with a scene may be predefined, or they may be constructed from base shader nodes by an operator using a phenomenon creator. The phenomenon creator ensures that phenomena are constructed so that the shaders in the DAG or cooperating DAGs can correctly cooperate during rendering of an image of the scene.
Prior to being attached to a scene, a phenomenon is instantiated by providing values, or functions which are used to define the values, for each of the phenomenon's parameters, using a phenomenon editor.
After a representation of a scene has been defined and phenomena attached, a scene image generator can generate an image of the scene. In that operation, the scene image generator operates in a series of phases, including a pre-processing phase, a rendering phase and a post-processing phase. During a pre-processing phase, the scene image generator can perform pre-processing operations, such as shadow and photon mapping, multiple inheritance resolution, and the like. The scene image generator may perform pre-processing operations if, for example, a phenomenon attached to the scene includes a geometry shader to generate geometry defined thereby for the scene. During the rendering phase, the scene image generator renders the image. During the post-processing phase, the scene image generator may perform post-processing operations if for example, a phenomenon attached to the scene includes a shader that defines post-processing operations, such as depth of field or motion blur calculations which are dependent on velocity and depth information stored in connection with each pixel value in the rendered image.
The phenomena system described in U.S. Pat. No. 6,496,190 is extremely useful. However, in recent years many shading platforms and languages have been developed, such that currently existing shader languages are narrowly focused on specific platforms and applications contexts, whether hardware shading for video games, or software shading for visual effects in motion pictures. This platform dependence typical of conventional shader systems and languages can be a significant limitation.
It would be desirable to provide shader methods and systems that are platform independent, and which can unite various shading tools and applications under a single language or system construct.
It would also be desirable to provide such methods and systems which enable the efficient and simple re-use and re-purposing of shaders, such as may be useful in the convergence of video games and feature films, an increasingly common occurrence (e.g., Lara Croft—Tomb Raider).
It would also be desirable to provide methods and systems that facilitate the design and construction of shaders without the need for computer programming, as may be useful for artists.
Still further, it would be desirable to provide such methods and systems that enable the graphical debugging of shaders, allowing shader creators to find and resolve defects in shaders.